const Router=require('koa-router');

const router=new Router();

router.get('/login-test',(ctx)=>{
  let token=ctx.request.header['x-access-token'];
  let messages={
    code:"-1",
    message:"请登录"
  };
  if(token){
    messages={
      code:"0",
      message:"欢迎管理员",
      token:"123",
      info:{
        user:"小明",
        roles:"admin",
        dynamicRoutes:[
          {
            path: "/test1",
            layout: "dashboard",
            meta:{
              title: "获取下拉菜单",
              icon: "VideoCameraOutlined",
            },
            children:[
              {
                path:"/a-test",
                meta:{
                  title: '获取测试',
                  icon: 'ExperimentOutlined',
                },
                component:"/test/Test"
              }
            ]
          }
        ]
      }
    }
  }

  ctx.body=messages
});

module.exports=router;
